package com.xioaye.cs.basic;

public class TestEqual
{
    private String name = "abc";
    public static void main(String[] args) {
        TestEqual test = new TestEqual();
        TestEqual testB = new TestEqual();
        String result = test.equals(testB) + ","; // 两个对象是不相等的
        result += test.name.equals(testB.name) + ","; // 两个对象的属性是相等的
        result += test.name == testB.name; // 字符串这么比较竟然也是相等的。
        System.out.println(result); // false ,true,true
    }

}
